<template>
  <div>
    姓名：<input type="text" v-model="username">
    手机号：<input type="text" v-model="total">
    <button @click="ti">提交订单</button>
  </div>

</template>

<script>
    export default {
        name: "show",
      data(){
          return {
            username:'',
            total:'',

          }
      },
      mounted() {

      },
      methods:{
          ti(){
            this.axios({
              url:'http://127.0.0.1:8000/show/',
              method:'post',
              data:{
                username: this.username,
                total: this.total
              }
            }).then(res=>{
                if (!/^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8])|(19[7]))\d{8}$/.test(this.total)) {
                alert('手机号格式不正确');
                return false;
              }else {
                  alert(res.data.message)
                }
                this.$router.push({'name':'allorder'})


            })
          },

      },

    }
</script>

<style scoped>

</style>
